<?php

namespace Facade;

include_once "SubSystem/SubSystemOne.php";
include_once "SubSystem/SubSystemTwo.php";
include_once "SubSystem/SubSystemThree.php";
include_once "SubSystem/SubSystemFour.php";

use Facade\SubSystem\ {SubSystemOne, SubSystemTwo, SubSystemThree, SubSystemFour};
/** 门面模式-外观类（门面类） */
class FacadeClass
{
    /** 定义属性，存放子系统实例 */
    private SubSystemOne $subSystemOne;
    private SubSystemTwo $subSystemTwo;
    private SubSystemThree $subSystemThree;
    private SubSystemFour $subSystemFour;

    public function __construct()
    {
        $this->subSystemOne = new SubSystemOne();
        $this->subSystemTwo = new SubSystemTwo();
        $this->subSystemThree = new SubSystemThree();
        $this->subSystemFour = new SubSystemFour();
    }

    /**
     * 门面方法
     * @return void
     */
    public function methodA()
    {
        echo "门面模式-方法A" . PHP_EOL;
        $this->subSystemOne->methodOne();
        $this->subSystemTwo->methodTwo();
    }

    /**
     * 门面方法
     * @return void
     */
    public function methodB()
    {
        echo "门面模式-方法B" . PHP_EOL;
        $this->subSystemThree->methodThree();
        $this->subSystemFour->methodFour();
    }
}